<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="css/base.css"/>
    <link rel="stylesheet" href="css/index.css"/>
    <link rel="stylesheet" href="css/login.css"/>
    <link rel="stylesheet" type="text/css" href="css/Style.css" media="all" /><!--页面整体样式-->
    <script src="js/jquery-1.7.2.js"></script>
    <script type="text/javascript">

        var url=location.search;
        var Request = new Object();
        if(url.indexOf("?")!=-1){
            var str = url.substr(1)　//去掉?号
            strs = str.split("&");
            for(var i=0;i<strs.length;i++){
                Request[strs[i ].split("=")[0]]=unescape(strs[i].split("=")[1]);
            }
        }
        var id = Request["id"];

        $(function(){
            $("#get").click(function(){
                var pwd1=$("#pwd1").val();
                var pwd2=$("#pwd2").val();
                if(pwd1.length<1){
                    alert("密码不能为空")
                    return false;
                }else if(pwd2.length<1){
                    alert("密码不能为空")
                    return false;
                }else if( pwd1!=pwd2){
                    alert("两次输入密码不一致")
                    return false;
                }else{

                        $.ajax({
                            url: "../member/pwd/modify.do",
                            async: false,
                            type: "post",
                            dataType: "json",
                            data: {"id": "" + id + "", "pwd": "" + pwd2 + ""},
                            success: function (data) {

                                if (data.success == false) {
                                    alert("修改失败")
                                } else {
                                    alert("密码修改成功")
                                    window.location.href = "../index.html";
                                }
                            }
                        });
                    }

            }).mousedown(function(){
                $("#get").addClass("l_anniu")
            }).mouseout(function(){
                $("#get").removeClass("l_anniu")
            });

        });



    </script>
</head>
<body>
<div id="header">

</div>
<div class="l_top">
</div>
<div class="l_content">
    <div class="l_input">
        <p class="l_title">找回密码</p>
        <p class="l_bai"></p>
        <form class="l_form">
            <span class="l_newpwd" >新密码 : </span><p><input type="password" id="pwd1" name="user" /><em></em></p>
            <span class="">确认新密码 :</span><p><input  type="password" id="pwd2" name="pwd" /><em></em></p>
            <div class="l_button top20"><input id="get" style="cursor: pointer" type="button" value="提 交"  /></div>
        </form>

    </div>
</div>



<div class="gContent4"></div>
<script>
    $.ajax({
        url:"x1Header.html",
        async:false,
        success:function(html){
            $("#header").append(html);
        }
    })
</script>
<script>
    $.ajax({
        url:"x2Footer.html",
        async:false,
        success:function(html){
            $(".gContent4").append(html);
        }
    })
</script>
</body>
</html>














